package com.lsk.division.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class DataVo implements Serializable {
    private String title;
    private String key;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<DataVo> children;
    //是否叶子结点,没有children则为叶子结点
    //@JsonAlias("isLeaf")
    @JsonProperty("isLeaf")
    private boolean isLeaf;

    public DataVo(String title, String key) {
        this.title = title;
        this.key = key;
       // this.isLeaf = true;
    }

    public DataVo(String title, String key, boolean isLeaf) {
        this.title = title;
        this.key = key;
        this.isLeaf = isLeaf;
    }
}
